package com.cdream.basic.algorithm.leetcode.bfs;

public class Offer14 {
    int res = 1;
    public int cuttingRope(int n) {
        if (n==2){
            return 1;
        }
        if(n==3){
            return 2;
        }
        while(n>4){
            res *= 3;
            n -=3;
        }
        return res;
    }

    public static void main(String[] args) {
        System.out.println(new Offer14().cuttingRope(40));
    }
}
